const http = require('http')

const server = http.createServer()

server.on('request', (req, resp) => {
    resp.setHeader('Content-Type', 'text/html;charset=utf-8')
    $url = req.url
    console.log($url)
    if($url == '/favicon.ico'){
        return
    }else if ($url == '/' || $url == '/index'){
        resp.end('首页')
    }else if($url == '/login'){
        resp.end('登录')
    }else{
        resp.end('404 not found')
    }
})

server.listen(80, () => {
    console.log('server running at http://127.0.0.1')
})
